package com.ansion.basedb.storage.api;

import androidx.annotation.NonNull;

/**
 * @author john on 2021/7/27.
 * @version 1.0
 * @desc
 */
public interface BaseKeyValueStorage {
    boolean remove(@NonNull String key);

    boolean contains(@NonNull String key);

    // int
    boolean putInt(@NonNull String key, int value);

    int getInt(@NonNull String key, int defValue);

    // long
    boolean putLong(@NonNull String key, long value);

    long getLong(@NonNull String key, long defValue);

    // float
    boolean putFloat(@NonNull String key, float value);

    float getFloat(@NonNull String key, float defValue);

    // string
    boolean putString(@NonNull String key, String value);

    String getString(@NonNull String key, String defValue);

    // boolean
    boolean putBoolean(@NonNull String key, boolean value);

    boolean getBoolean(@NonNull String key, boolean defValue);


    boolean putByteArray(@NonNull String key, byte[] value);

    byte[] getByteArray(@NonNull String key, byte[] defValue);

}
